package com.mzj.saas.commons.exception.handle;

import java.io.Serializable;

import com.mzj.saas.commons.exception.ErrorCode;

/**
 * @Author: wangrl
 * @Description: 定义controller 统一返回的格式
 * @Date: 21:34 2018/7/26
 * @Version: 1.0
 */
public class ResultVo<T> implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Integer code = ErrorCode.OK.code(); //返回状态码
	private String msg; //提示信息   
    private T data;

    public ResultVo() {
        super();
    }

    public ResultVo(T data) {
        super();
        this.data = data;
    }

    public ResultVo(Throwable e) {
        super();
        this.code = ErrorCode.FAIL.code();
        this.msg = e.getMessage();
    }

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

}
